import 'package:boss/color_constant.dart';
import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/page/offersManagement/page/plusOffersMode/model/offers_mode.dart';
import 'package:boss/ui/widget/shadow_radius_card.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

class PlusOffersModeItem extends StatelessWidget {
  final OffersMode data;
  final VoidCallback onTap;

  const PlusOffersModeItem({Key key, this.data, this.onTap}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ShadowRadiusCard(
      margin: EdgeInsets.symmetric(
        vertical: 16.w,
      ),
      padding: EdgeInsets.only(
        left: 20.w,
        right: 12.w,
        top: 20.w,
        bottom: 20.w,
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: <Widget>[
          Row(
            children: <Widget>[
              Container(
                width: 80.w,
                height: 80.w,
                margin: EdgeInsets.only(
                  right: 20.w,
                ),
                decoration: BoxDecoration(
                  shape: BoxShape.circle,
                  color: data.iconColor,
                ),
                alignment: Alignment.center,
                child: Text(
                  data.iconText,
                  style: TextStyle(
                    color: data.iconTextColor,
                    fontSize: 24.sp,
                  ),
                ),
              ),
              Column(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: <Widget>[
                  Text(
                    data.name,
                    style: TextStyleConstant().normal_1_32,
                  ),
                  Text(
                    data.desc,
                    style: TextStyleConstant().normal_3_24,
                  ),
                ],
              )
            ],
          ),
          GestureDetector(
            onTap: onTap,
            behavior: HitTestBehavior.translucent,
            child: Padding(
              padding: EdgeInsets.all(8),
              child: Container(
                width: 100.w,
                height: 40.w,
                decoration: BoxDecoration(
                  color: ColorConstant.fe7f76.withOpacity(0.1),
                  borderRadius: BorderRadius.circular(
                    20.w,
                  ),
                ),
                alignment: Alignment.center,
                child: Text(
                  '创建',
                  style: TextStyleConstant().origin_24,
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
